package com.dup.jxlh.admin.mapper;

import com.dup.jxlh.api.entities.DictionaryData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigInteger;
import java.util.ArrayList;

@Mapper
public interface DictionaryDataMapper {
    @Select("select * from company where pid = #{companyId}")
    ArrayList<DictionaryData> getCompanyData(@Param("companyId") BigInteger companyId);

    @Select("select * from department where company_id = #{companyId}")
    ArrayList<DictionaryData> getDepartmentData(@Param("companyId") BigInteger companyId);

    @Select("select * from department where id = #{id}")
    ArrayList<DictionaryData> getDepartmentById(@Param("id") BigInteger id);

    @Select("select * from role where company_id = #{companyId}")
    ArrayList<DictionaryData> getRoleData(@Param("companyId") BigInteger companyId);

    @Select("select id,realname as name from admin where company_id = #{companyId} and is_enable = 1")
    ArrayList<DictionaryData> getAdminData(@Param("companyId") BigInteger companyId);
}
